package com.nbcio.modules.estar.bd.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nbcio.modules.estar.bd.entity.SysErpUser;
import com.nbcio.modules.estar.bd.mapper.SysErpUserMapper;
import com.nbcio.modules.estar.bd.service.ISysErpUserService;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.CacheConstant;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

@Service
@Slf4j
public class SysErpUserServiceImpl extends ServiceImpl<SysErpUserMapper, SysErpUser> implements ISysErpUserService {

    @Override
    @CacheEvict(value={CacheConstant.SYS_USERS_CACHE}, allEntries=true)
    @Transactional(rollbackFor = Exception.class)
    public void deleteBatchUsers(List<String> userIds) {
        //1.删除用户
        this.removeByIds(userIds);
    }
}
